package mk.edu.ii.navigatemacedonia;

public class ServiceURL {
	
	
	//private static final String URL = "http://diplomska.serveftp.net/SiteService/Service.svc/";
	//private static final String URL = "http://192.168.1.108/servisot/Service.svc/";
	//public static final String HOST = "http://192.168.1.120/";
	
	//public static final String HOST = "http://diplomska.serveftp.net/";
	public static final String HOST = "http://navigatemacedonia.info/";
	
	//public static  String URL = HOST + "Navigate/";
	public static  String URL = HOST;
	
	private static String SERVICE_URL = HOST + "servis/service.svc/";
	//private static String SERVICE_URL = HOST + "servisot/Service.svc/";
	
	private static final String LOGIN_METHOD = "Login?";
	private static final String GETSITES_METHOD = "GetData?";
	private static final String UPDATE_METHOD = "Update?";
	private static final String RATE_METHOD = "Rate?";
	
	public static String getSitesMethodURL(Double longitude, Double latitude, Integer radius,
    		String category, String subcategory, String searchText ){
    	String url;
    	
    	//http://192.168.1.106/SiteService/Service.svc/GetData?param1=1&param2=1&param3=1&param4=1
    	url = SERVICE_URL + GETSITES_METHOD + "param1="+latitude.toString()
    			+ "&param2="+longitude.toString()
    			+ "&param3="+radius.toString()
    			+ "&param4="+category
    			+ "&param5="+subcategory
    			+ "&param6="+searchText;
    	
		//int duration = Toast.LENGTH_SHORT;
		//Toast toast = Toast.makeText(v.getContext(), url, duration);
		//toast.show();
    	return url;
    }
	
	public static String loginMethodURL(String username, String password){
		String url = "";
		url = SERVICE_URL + LOGIN_METHOD + "param1=" + username
				+ "&param2=" + password;
		return url;
	}
	
	public static String updateURL(String userkey){
		String url = "";
		url = SERVICE_URL + UPDATE_METHOD + "param1=" + userkey;
		return url;
	}
	
	public static String rateURL(String userkey, String site_id, String rating){
		String url = "";
		url = SERVICE_URL + RATE_METHOD + "param1=" + userkey
		+ "&param2=" + site_id
		+ "&param3=" + rating;
		return url;
	}
}
